import tkinter;
import sys;
import os;

def begin_crawler():
    global OJ_input;
    global UserID_input;
    OJ = str(OJ_input.get());
    UserID = str(UserID_input.get());
    print(OJ);
    print(UserID);
    os.system(OJ+"_crawler.py "+UserID);

show = tkinter.Tk();
show.geometry("300x300");
# 这是输入框
OJ_label = tkinter.Label(show, text="OJ     ");
OJ_label.grid(row=0, column=0);

OJ_input = tkinter.Entry(show);
OJ_input.grid(row=0, column=30);

UserID_label = tkinter.Label(show, text="USER_ID");
UserID_label.grid(row=20, column=0);

UserID_input = tkinter.Entry(show);
UserID_input.grid(row=20, column=30);

Begin = tkinter.Button(show, text="Crawler!", command=begin_crawler);
Begin.grid(row=40,column=30);
show.title("OJ_crawler");

show.mainloop();

